package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 产品入库录表
 * @TableName wm_item_recpt
 */
@TableName(value ="wm_item_recpt")
@Data
public class WmItemRecpt implements Serializable {
    /**
     * 入库单编号
     */
    @TableId(type = IdType.AUTO)
    private Integer recptId;

    /**
     * 入库单编号
     */
    private String recptCode;

    /**
     * 入库单名称
     */
    private String recptName;

    /**
     * 生产工单ID
     */
    private Integer workorderId;

    /**
     * 生产工单编码
     */
    private String workorderCode;

    /**
     * 生产工单名称
     */
    private String workorderName;

    /**
     * 采购订单编号
     */
    private String poCode;

    /**
     * 供应商id
     */
    private Integer supplierId;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 供应商简称
     */
    private String supplierAbbreviation;

    /**
     * 仓库编号
     */
    private Integer warehouseId;

    /**
     * 仓库编码
     */
    private String warehouseCode;

    /**
     * 仓库名称
     */
    private String warehouseName;

    /**
     * 库区编号
     */
    private Integer warehouseAreaId;

    /**
     * 库区编码
     */
    private String warehouseAreaCode;

    /**
     * 库区名称
     */
    private String warehouseAreaName;

    /**
     * 库位编号
     */
    private Integer warehouseLocationId;

    /**
     * 库位编码
     */
    private String warehouseLocationCode;

    /**
     * 库位名称
     */
    private String warehouseLocationName;

    /**
     * 入库日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date recptDate;

    /**
     * 状态
     */
    private String status;

    /**
     * 备注信息
     */
    private String remark;


    private String unitName;

    /**
     * 总金额
     */
    private BigDecimal totalAmount;
    @TableField(exist = false)
    private List<WmItemRecptLine> line;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WmItemRecpt other = (WmItemRecpt) that;
        return (this.getRecptId() == null ? other.getRecptId() == null : this.getRecptId().equals(other.getRecptId()))
            && (this.getRecptCode() == null ? other.getRecptCode() == null : this.getRecptCode().equals(other.getRecptCode()))
            && (this.getRecptName() == null ? other.getRecptName() == null : this.getRecptName().equals(other.getRecptName()))
            && (this.getWorkorderId() == null ? other.getWorkorderId() == null : this.getWorkorderId().equals(other.getWorkorderId()))
            && (this.getWorkorderCode() == null ? other.getWorkorderCode() == null : this.getWorkorderCode().equals(other.getWorkorderCode()))
            && (this.getWorkorderName() == null ? other.getWorkorderName() == null : this.getWorkorderName().equals(other.getWorkorderName()))
            && (this.getPoCode() == null ? other.getPoCode() == null : this.getPoCode().equals(other.getPoCode()))
            && (this.getSupplierId() == null ? other.getSupplierId() == null : this.getSupplierId().equals(other.getSupplierId()))
            && (this.getSupplierCode() == null ? other.getSupplierCode() == null : this.getSupplierCode().equals(other.getSupplierCode()))
            && (this.getSupplierName() == null ? other.getSupplierName() == null : this.getSupplierName().equals(other.getSupplierName()))
            && (this.getSupplierAbbreviation() == null ? other.getSupplierAbbreviation() == null : this.getSupplierAbbreviation().equals(other.getSupplierAbbreviation()))
            && (this.getWarehouseId() == null ? other.getWarehouseId() == null : this.getWarehouseId().equals(other.getWarehouseId()))
            && (this.getWarehouseCode() == null ? other.getWarehouseCode() == null : this.getWarehouseCode().equals(other.getWarehouseCode()))
            && (this.getWarehouseName() == null ? other.getWarehouseName() == null : this.getWarehouseName().equals(other.getWarehouseName()))
            && (this.getWarehouseAreaId() == null ? other.getWarehouseAreaId() == null : this.getWarehouseAreaId().equals(other.getWarehouseAreaId()))
            && (this.getWarehouseAreaCode() == null ? other.getWarehouseAreaCode() == null : this.getWarehouseAreaCode().equals(other.getWarehouseAreaCode()))
            && (this.getWarehouseAreaName() == null ? other.getWarehouseAreaName() == null : this.getWarehouseAreaName().equals(other.getWarehouseAreaName()))
            && (this.getWarehouseLocationId() == null ? other.getWarehouseLocationId() == null : this.getWarehouseLocationId().equals(other.getWarehouseLocationId()))
            && (this.getWarehouseLocationCode() == null ? other.getWarehouseLocationCode() == null : this.getWarehouseLocationCode().equals(other.getWarehouseLocationCode()))
            && (this.getWarehouseLocationName() == null ? other.getWarehouseLocationName() == null : this.getWarehouseLocationName().equals(other.getWarehouseLocationName()))
            && (this.getRecptDate() == null ? other.getRecptDate() == null : this.getRecptDate().equals(other.getRecptDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecptId() == null) ? 0 : getRecptId().hashCode());
        result = prime * result + ((getRecptCode() == null) ? 0 : getRecptCode().hashCode());
        result = prime * result + ((getRecptName() == null) ? 0 : getRecptName().hashCode());
        result = prime * result + ((getWorkorderId() == null) ? 0 : getWorkorderId().hashCode());
        result = prime * result + ((getWorkorderCode() == null) ? 0 : getWorkorderCode().hashCode());
        result = prime * result + ((getWorkorderName() == null) ? 0 : getWorkorderName().hashCode());
        result = prime * result + ((getPoCode() == null) ? 0 : getPoCode().hashCode());
        result = prime * result + ((getSupplierId() == null) ? 0 : getSupplierId().hashCode());
        result = prime * result + ((getSupplierCode() == null) ? 0 : getSupplierCode().hashCode());
        result = prime * result + ((getSupplierName() == null) ? 0 : getSupplierName().hashCode());
        result = prime * result + ((getSupplierAbbreviation() == null) ? 0 : getSupplierAbbreviation().hashCode());
        result = prime * result + ((getWarehouseId() == null) ? 0 : getWarehouseId().hashCode());
        result = prime * result + ((getWarehouseCode() == null) ? 0 : getWarehouseCode().hashCode());
        result = prime * result + ((getWarehouseName() == null) ? 0 : getWarehouseName().hashCode());
        result = prime * result + ((getWarehouseAreaId() == null) ? 0 : getWarehouseAreaId().hashCode());
        result = prime * result + ((getWarehouseAreaCode() == null) ? 0 : getWarehouseAreaCode().hashCode());
        result = prime * result + ((getWarehouseAreaName() == null) ? 0 : getWarehouseAreaName().hashCode());
        result = prime * result + ((getWarehouseLocationId() == null) ? 0 : getWarehouseLocationId().hashCode());
        result = prime * result + ((getWarehouseLocationCode() == null) ? 0 : getWarehouseLocationCode().hashCode());
        result = prime * result + ((getWarehouseLocationName() == null) ? 0 : getWarehouseLocationName().hashCode());
        result = prime * result + ((getRecptDate() == null) ? 0 : getRecptDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recptId=").append(recptId);
        sb.append(", recptCode=").append(recptCode);
        sb.append(", recptName=").append(recptName);
        sb.append(", workorderId=").append(workorderId);
        sb.append(", workorderCode=").append(workorderCode);
        sb.append(", workorderName=").append(workorderName);
        sb.append(", poCode=").append(poCode);
        sb.append(", suppplierId=").append(supplierId);
        sb.append(", supplierCode=").append(supplierCode);
        sb.append(", supplierName=").append(supplierName);
        sb.append(", supplierAbbreviation=").append(supplierAbbreviation);
        sb.append(", warehouseId=").append(warehouseId);
        sb.append(", warehouseCode=").append(warehouseCode);
        sb.append(", warehouseName=").append(warehouseName);
        sb.append(", warehouseAreaId=").append(warehouseAreaId);
        sb.append(", warehouseAreaCode=").append(warehouseAreaCode);
        sb.append(", warehouseAreaName=").append(warehouseAreaName);
        sb.append(", warehouseLocationId=").append(warehouseLocationId);
        sb.append(", warehouseLocationCode=").append(warehouseLocationCode);
        sb.append(", warehouseLocationName=").append(warehouseLocationName);
        sb.append(", recptDate=").append(recptDate);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", totalAmount=").append(totalAmount);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}